{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Network:\n",
    "    def is_url_valid(self):\n",
    "        return True\n",
    "    def is_dns_work(self):\n",
    "        return True\n",
    "    def is_user_valid(self):\n",
    "        return"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def download_nested():\n",
    "    if Network.is_url_valid():\n",
    "        if Network.is_dns_work():\n",
    "            if Network.is_user_valid():\n",
    "                print('start downloading.....')\n",
    "            else:\n",
    "                print('user invalid')\n",
    "        else:\n",
    "            print('dns error')\n",
    "    else:\n",
    "        print('url invalid')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def download_flat():\n",
    "    if not Network.is_url_valid():\n",
    "        print('url invalid')\n",
    "        return\n",
    "    elif not Network.is_dns_work():\n",
    "        print('dns error')\n",
    "        return\n",
    "    elif not Network.is_user_valid():\n",
    "        print('user invalid')\n",
    "        return\n",
    "           \n",
    "    print('start downloading.....')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
